ifeq ($(KERNELRELEASE),)
	 
KERNELDIR :=/home/fown/nfs2/linux-2.6.24   #指向你的内核代码目录
KDIR :=/lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
 
all:
	     $(MAKE) -C $(KDIR) M=$(PWD) modules      #编译内核模块的指令
clean:                 	
	     rm -rf modules.* *.o *~ core .depend .*.cmd *.ko 
.PHONY: modules modules_install clean
else
	 
	     obj-m := fown.o                                 #你要编译的模块名称
	      
      endif

